﻿using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Futures
{
    /// <summary>
    /// 商品分类
    /// </summary>
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tbWaresCategory"),Serializable]
    public class WaresCategory
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        /// <summary>
        /// 索引号
        /// </summary>
        private int index;
        /// <summary>
        /// 中文分类名称
        /// </summary>
        private string chineseName;
        /// <summary>
        /// 西文分类名称
        /// </summary>
        private string englishName;
        /// <summary>
        /// 上级分类
        /// </summary>
        private Guid parentGuid = Guid.Empty;

        /// <summary>
        /// 索引号
        /// </summary>
        [Property]
        public int CateIndex
        {
            get { return index; }
            set { index = value; }
        }

        /// <summary>
        /// 中文分类名称
        /// </summary>
        [Property]
        public string ChineseName
        {
            get { return chineseName; }
            set { chineseName = value; }
        }

        /// <summary>
        /// 中文分类名称
        /// </summary>
        [Property]
        public string EnglishName
        {
            get { return englishName; }
            set { englishName = value; }
        }

        /// <summary>
        /// 上级分类
        /// </summary>
        [Property]
        public Guid ParentGuid
        {
            get { return parentGuid; }
            set { parentGuid = value; }
        }
    }
}